package cn.maihe.elg.operation.institution;

import cn.maihe.elg.operation.institution.service.ZhtGuarantorPushGuaranteeService;
import cn.maihe.elg.operation.institution.service.ZhtNotifyOrderStatus;
import cn.maihe.elg.operation.model.enums.InstitutionCode;
import cn.maihe.elg.operation.model.dto.BaseReq;
import cn.maihe.elg.operation.model.dto.BaseResp;
import cn.maihe.elg.operation.model.dto.InnerBaseResp;
import cn.maihe.elg.operation.model.dto.institution.ApplyOrderReqDTO;
import cn.maihe.elg.operation.model.dto.institution.NotifyOrderReqDTO;
import cn.maihe.elg.operation.institution.service.ZhtApplyGuaranteeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Description 中天出
 * @Author WJH
 * @Date 2021/05/10
 */
@Service
public class ZhtInstitutionService implements InstitutionServiceInterface {

    @Resource
    private ZhtApplyGuaranteeService zhtApplyGuaranteeService;
    @Resource
    private ZhtNotifyOrderStatus zhtNotifyOrderStatus;
    @Resource
    private ZhtGuarantorPushGuaranteeService pushGuaranteeService;

    @Override
    public InstitutionCode institutionCodeEnum() {
        return InstitutionCode.zhongTian;
    }

    @Override
    public InnerBaseResp<BaseResp> applyGuarantee(BaseReq req, Map<String, Object> attrMap) {
        return zhtApplyGuaranteeService.doService((ApplyOrderReqDTO) req, attrMap);
    }

    @Override
    public InnerBaseResp<BaseResp> notifyOrderStatus(BaseReq req, Map<String, Object> attrMap) {
        return zhtNotifyOrderStatus.doService((NotifyOrderReqDTO) req, attrMap);
    }

    @Override
    public InnerBaseResp<BaseResp> pushGuarantee(InnerBaseResp innerBaseResp) {
        return pushGuaranteeService.pushGuarantee(innerBaseResp);
    }
}
